<template>
  <div class="mt-search">
    <el-row :gutter="0">
      <el-col :span="6" class="logotitle">
        <img src="//s0.meituan.net/bs/fe-web-meituan/fa5f0f0/img/logo.png" alt />
      </el-col>
      <el-col :span="16" class="searchPart">
        <div class="searchInput">
          <input 
          type="text" 
          placeholder="搜索商家或地点"
          v-model="search" 
          @focus="focus"
          @blur="blur"
          @input="input"
          />
          <!-- <el-input placeholder="搜索商家或地点"></el-input> -->
          <button class="el-button el-button-primary">
            <i class="el-icon-search"></i>
          </button>
          <dl class="hotList" v-if="ishotList">
            <dt>热门搜索</dt>
            <dd v-for="(item,idx) in hotList" :key="idx">{{item}}</dd>
          </dl>
          <dl class="searchList" v-if="isSearchList">
            <dd v-for="(item,idx) in searchList" :key="idx">{{item}}</dd>
          </dl>
        </div>
        <div class="suggest">
          <a href>故宫</a>
          <a href>长城</a>
          <a href>沪小二铜炉蛙锅</a>
          <a href>北京雪都滑雪场</a>
          <a href>天坛</a>
        </div>
        <ul class="nav">
          <li>
            <nuxt-link to="/takeout" class="takeout">美团外卖</nuxt-link>
          </li>
          <li>
            <nuxt-link to="/movie" class="movie">猫眼电影</nuxt-link>
          </li>
          <li>
            <nuxt-link to="/hotel" class="hotel">美团酒店</nuxt-link>
          </li>
          <li>
            <nuxt-link to="/apartment" class="apartment">民宿/公寓</nuxt-link>
          </li>
          <li>
            <nuxt-link to="/store" class="store">商家入驻</nuxt-link>
          </li>
          <li>
            <nuxt-link to="/welfare" class="welfare">美团公益</nuxt-link>
          </li>
        </ul>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  components: {},
  props: {},
  data() {
    return {
      search: "",
      isFocus: false,
      hotList: ['火锅','火锅','火锅','火锅','火锅'],
      searchList: ['烧烤','故宫']
    };
  },
  watch: {},
  computed: {
    ishotList: function() {
      return this.isFocus && !this.search;
    },
    isSearchList: function() {
      return this.isFocus && this.search;
    }
  },
  methods: {
    focus() {
      this.isFocus = true
    },
    blur() {
      this.isFocus = false
    },
    input() {
      console.log('去获取数据')
    }

  },
  created() {},
  mounted() {}
};
</script>
<style lang="scss" scoped>
@import "@/assets/css/public/header/search";
</style>